//
//  MyMoenyViewController.m
//  penzer
//
//  Created by caiyc on 2018/11/15.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "MyMoenyViewController.h"
#import "MoneyInfoTableViewCell.h"
#import "MoneyDetailViewController.h"
@interface MyMoenyViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end

@implementation MyMoenyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的押金";
    [self setUpTableView];
}


-(void)setUpTableView
{
     [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([MoneyInfoTableViewCell class]) bundle:nil]  forCellReuseIdentifier:NSStringFromClass([MoneyInfoTableViewCell class])];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.estimatedRowHeight = 400;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    __weak typeof(self)weakSelf=self;
    MoneyInfoTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MoneyInfoTableViewCell class])];
    cell.recharge=^(){
        
    };
    cell.withDraw=^(){
        MoneyDetailViewController *vc = [[MoneyDetailViewController alloc]init];
        [self.navigationController pushViewController:vc animated:NO];
    };
    return cell;
}


@end
